package com.zyd.shiro.business.enums;

/**
 * @Classname RespCode
 * @Description TODO
 * @Date 2020/6/14 8:14
 * @Created by King
 */
public enum EquStatus {
    MIN(1, "在线"),
    SMALL(2, "离线"),
    MID(3, "正常");

    private Integer code;
    private String msg;

    EquStatus(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static String getMsgByCode(int code) {
        for (EquStatus equStatus : EquStatus.values()) {
            if (equStatus.getCode() == code) {
                return equStatus.getMsg();
            }
        }
        return "未知";
    }
}
